
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>8.2.5 Populate_Geometry_Columns · PostGIS中文指南</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="xxx">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-okaidia.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-folding-chapters/folding-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="UpdateGeometrySRID.html" />
    
    
    <link rel="prev" href="Find_SRID.html" />
    

    <script src="../../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        <li class="header">第 Ⅰ 部分：PostGIS基础</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    一 初识PostGIS
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../introduction/PostgisAbility.html">
            
                <a href="../../introduction/PostgisAbility.html">
            
                    
                    1.1 PostGIS特性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../../introduction/PostgisAbility.html">
            
                <a href="../../introduction/PostgisAbility.html">
            
                    
                    1.2 PostGIS使用场景
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.2.1" data-path="../../installation/PostgreSQL Installation.html">
            
                <a href="../../installation/PostgreSQL Installation.html">
            
                    
                    1.2.1 适用场景
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.2" data-path="../../installation/PostGIS Installation.html">
            
                <a href="../../installation/PostGIS Installation.html">
            
                    
                    1.2.2 不适用场景
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../../introduction/PostgisAbility.html">
            
                <a href="../../introduction/PostgisAbility.html">
            
                    
                    1.3 PostGIS使用建议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" >
            
                <span>
            
                    
                    1.4 PostGIS安装
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.4.1" data-path="../../installation/PostgreSQL Installation.html">
            
                <a href="../../installation/PostgreSQL Installation.html">
            
                    
                    1.4.1 PostgreSQL安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.2" data-path="../../installation/PostGIS Installation.html">
            
                <a href="../../installation/PostGIS Installation.html">
            
                    
                    1.4.2 PostGIS安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../../introduction/ReleaseNotes.html">
            
                <a href="../../introduction/ReleaseNotes.html">
            
                    
                    1.5 PostGIS重大版本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    二 PostGIS入门
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" >
            
                <span>
            
                    
                    2.1 客户端介绍
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" >
            
                <span>
            
                    
                    2.1.1 psql
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" >
            
                <span>
            
                    
                    2.1.2 qgis
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" >
            
                <span>
            
                    
                    2.2 空间数据库
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" >
            
                <span>
            
                    
                    2.3 数据导入
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.1" >
            
                <span>
            
                    
                    2.3.1 shp
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2" >
            
                <span>
            
                    
                    2.3.2 csv
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.3" >
            
                <span>
            
                    
                    2.3.3 excel
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">第 Ⅱ 部分：API手册</li>
        
        
    
        <li class="chapter " data-level="2.1" >
            
                <span>
            
                    
                    八 矢量函数
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" >
            
                <span>
            
                    
                    8.2 空间表管理
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1.1" data-path="AddGeometryColumn.html">
            
                <a href="AddGeometryColumn.html">
            
                    
                    8.2.1 AddGeometryColumn
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.2" data-path="DropGeometryColumn.html">
            
                <a href="DropGeometryColumn.html">
            
                    
                    8.2.2 DropGeometryColumn
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.3" data-path="DropGeometryTable.html">
            
                <a href="DropGeometryTable.html">
            
                    
                    8.2.3 DropGeometryTable
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.4" data-path="Find_SRID.html">
            
                <a href="Find_SRID.html">
            
                    
                    8.2.4 Find_SRID
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.1.1.5" data-path="Populate_Geometry_Columns.html">
            
                <a href="Populate_Geometry_Columns.html">
            
                    
                    8.2.5 Populate_Geometry_Columns
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.6" data-path="UpdateGeometrySRID.html">
            
                <a href="UpdateGeometrySRID.html">
            
                    
                    8.2.6 UpdateGeometrySRID
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.2" >
            
                <span>
            
                    
                    8.4 元数据读写
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.2.1" data-path="../Accessors.html">
            
                <a href="../Accessors.html#GeometryType">
            
                    
                    GeometryType
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.2" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_GeometryType">
            
                    
                    ST_GeometryType
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.3" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_CoordDim">
            
                    
                    ST_CoordDim与ST_NDims
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.4" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_Dimension">
            
                    
                    ST_Dimension
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.5" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_Zmflag">
            
                    
                    ST_Zmflag
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.6" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_HasArc">
            
                    
                    ST_HasArc
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.7" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_IsPolygonCCW">
            
                    
                    ST_IsPolygonCCW
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.8" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_IsPolygonCW">
            
                    
                    ST_IsPolygonCW
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.9" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_IsClosed">
            
                    
                    ST_IsClosed
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.10" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_IsCollection">
            
                    
                    ST_IsCollection
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.11" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_IsEmpty">
            
                    
                    ST_IsEmpty
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.12" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_IsRing">
            
                    
                    ST_IsRing
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.13" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_IsSimple">
            
                    
                    ST_IsSimple
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.14" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_Boundary">
            
                    
                    ST_Boundary
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.15" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_Envelope">
            
                    
                    ST_Envelope
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.16" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_BoundingDiagonal">
            
                    
                    ST_BoundingDiagonal
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.17" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_X">
            
                    
                    ST_X,ST_Y,ST_Z,ST_M
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.18" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_StartPoint">
            
                    
                    ST_StartPoint,ST_EndPoint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.19" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_NumGeometries">
            
                    
                    ST_NumGeometries,ST_GeometryN
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.20" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_NRings">
            
                    
                    ST_NRings,ST_ExteriorRing,ST_NumInteriorRings,ST_NumInteriorRing,ST_InteriorRingN
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.21" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_NumPatches">
            
                    
                    ST_NumPatches,ST_PatchN
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.22" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_NPoints">
            
                    
                    ST_NPoints,ST_NumPoints,ST_PointN,ST_Points
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.23" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_MemSize">
            
                    
                    ST_MemSize
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.24" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_Summary">
            
                    
                    ST_Summary
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.25" data-path="../Accessors.html">
            
                <a href="../Accessors.html#ST_Dump">
            
                    
                    ST_Dump,ST_DumpPoints,ST_DumpRings
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.3" >
            
                <span>
            
                    
                    8.11 空间关系
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.3.1" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Intersects">
            
                    
                    ST_Intersects
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.2" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Intersects">
            
                    
                    ST_Disjoint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.3" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Contains">
            
                    
                    ST_Contains
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.4" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Contains">
            
                    
                    ST_Within
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.5" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Equals">
            
                    
                    ST_Equals
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.6" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_ContainsProperly">
            
                    
                    ST_ContainsProperly
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.7" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Covers">
            
                    
                    ST_Covers
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.8" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Covers">
            
                    
                    ST_CoveredBy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.9" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Overlaps">
            
                    
                    ST_Overlaps
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.10" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Overlaps">
            
                    
                    ST_Crosses
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.11" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Touches">
            
                    
                    ST_Touches
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.12" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_Relate">
            
                    
                    ST_Relate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.13" data-path="../SpatialRelationships.html">
            
                <a href="../SpatialRelationships.html#ST_RelateMatch">
            
                    
                    ST_RelateMatch
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.4" >
            
                <span>
            
                    
                    8.12 空间测量
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.4.1" data-path="../Measurement/ST_3DClosestPoint.html">
            
                <a href="../Measurement/ST_3DClosestPoint.html#ST_3DClosestPoint">
            
                    
                    ST_3DClosestPoint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.2" data-path="../Measurement/ST_3DDistance.html">
            
                <a href="../Measurement/ST_3DDistance.html">
            
                    
                    ST_3DDistance
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.3" data-path="../Measurement/ST_Angle.html">
            
                <a href="../Measurement/ST_Angle.html">
            
                    
                    ST_Angle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.4" data-path="../Measurement/ST_Area.html">
            
                <a href="../Measurement/ST_Area.html">
            
                    
                    ST_Area
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.5" data-path="../Measurement/ST_Azimuth.html">
            
                <a href="../Measurement/ST_Azimuth.html">
            
                    
                    ST_Azimuth
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.6" data-path="../Measurement/ST_ClosestPoint.html">
            
                <a href="../Measurement/ST_ClosestPoint.html">
            
                    
                    ST_ClosestPoint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.7" data-path="../Measurement/ST_Distance.html">
            
                <a href="../Measurement/ST_Distance.html">
            
                    
                    ST_Distance
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.8" data-path="../Measurement/ST_Project.html">
            
                <a href="../Measurement/ST_Project.html">
            
                    
                    ST_Project
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.5" >
            
                <span>
            
                    
                    8.14 仿射变换
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.5.1" data-path="../AffineTransformations/ST_Affine.html">
            
                <a href="../AffineTransformations/ST_Affine.html#ST_Affine">
            
                    
                    ST_Affine
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.2" data-path="../AffineTransformations/ST_Rotate.html">
            
                <a href="../AffineTransformations/ST_Rotate.html">
            
                    
                    ST_Rotate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.3" data-path="../AffineTransformations/ST_RotateX.html">
            
                <a href="../AffineTransformations/ST_RotateX.html">
            
                    
                    ST_RotateX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.4" data-path="../AffineTransformations/ST_RotateY.html">
            
                <a href="../AffineTransformations/ST_RotateY.html">
            
                    
                    ST_RotateY
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.5" data-path="../AffineTransformations/ST_RotateZ.html">
            
                <a href="../AffineTransformations/ST_RotateZ.html">
            
                    
                    ST_RotateZ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.6" data-path="../AffineTransformations/ST_Scale.html">
            
                <a href="../AffineTransformations/ST_Scale.html">
            
                    
                    ST_Scale
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.7" data-path="../AffineTransformations/ST_Translate.html">
            
                <a href="../AffineTransformations/ST_Translate.html">
            
                    
                    ST_Translate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.8" data-path="../AffineTransformations/ST_TransScale.html">
            
                <a href="../AffineTransformations/ST_TransScale.html">
            
                    
                    ST_TransScale
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.6" >
            
                <span>
            
                    
                    8.15 空间聚类
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.6.1" data-path="../Clustering.html">
            
                <a href="../Clustering.html#ST_ClusterDBSCAN">
            
                    
                    ST_ClusterDBSCAN
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.2" data-path="../Clustering.html">
            
                <a href="../Clustering.html#ST_ClusterIntersecting">
            
                    
                    ST_ClusterIntersecting
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.3" data-path="../Clustering.html">
            
                <a href="../Clustering.html#ST_ClusterKMeans">
            
                    
                    ST_ClusterKMeans
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.4" data-path="../Clustering.html">
            
                <a href="../Clustering.html#ST_ClusterWithin">
            
                    
                    ST_ClusterWithin
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.7" >
            
                <span>
            
                    
                    8.16 线性参考
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.7.1" data-path="../LinearReferencing/ST_LineInterpolatePoint.html">
            
                <a href="../LinearReferencing/ST_LineInterpolatePoint.html">
            
                    
                    ST_LineInterpolatePoint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.2" data-path="../LinearReferencing/ST_3dLineInterpolatePoint.html">
            
                <a href="../LinearReferencing/ST_3dLineInterpolatePoint.html">
            
                    
                    ST_3dLineInterpolatePoint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.3" data-path="../LinearReferencing/ST_LineInterpolatePoints.html">
            
                <a href="../LinearReferencing/ST_LineInterpolatePoints.html">
            
                    
                    ST_LineInterpolatePoints
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.4" data-path="../LinearReferencing/ST_LineLocatePoint.html">
            
                <a href="../LinearReferencing/ST_LineLocatePoint.html">
            
                    
                    ST_LineLocatePoint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.5" data-path="../LinearReferencing/ST_LineSubstring.html">
            
                <a href="../LinearReferencing/ST_LineSubstring.html">
            
                    
                    ST_LineSubstring
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.6" data-path="../LinearReferencing/ST_LocateAlong.html">
            
                <a href="../LinearReferencing/ST_LocateAlong.html">
            
                    
                    ST_LocateAlong
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.7" data-path="../LinearReferencing/ST_LocateBetween.html">
            
                <a href="../LinearReferencing/ST_LocateBetween.html">
            
                    
                    ST_LocateBetween
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.8" data-path="../LinearReferencing/ST_LocateBetweenElevations.html">
            
                <a href="../LinearReferencing/ST_LocateBetweenElevations.html">
            
                    
                    ST_LocateBetweenElevations
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.9" data-path="../LinearReferencing/ST_InterpolatePoint.html">
            
                <a href="../LinearReferencing/ST_InterpolatePoint.html">
            
                    
                    ST_InterpolatePoint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.10" data-path="../LinearReferencing/ST_AddMeasure.html">
            
                <a href="../LinearReferencing/ST_AddMeasure.html">
            
                    
                    ST_AddMeasure
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.11" data-path="../LinearReferencing/examples.html">
            
                <a href="../LinearReferencing/examples.html">
            
                    
                    综合案例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">第 Ⅲ 部分：PostGIS++</li>
        
        
    

    
        
        <li class="header">第 Ⅳ 部分：常见问题</li>
        
        
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >8.2.5 Populate_Geometry_Columns</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="populategeometrycolumns">Populate_Geometry_Columns</h2>
<h3 id="&#x65B9;&#x6CD5;&#x529F;&#x80FD;&#x63CF;&#x8FF0;">&#x65B9;&#x6CD5;&#x529F;&#x80FD;&#x63CF;&#x8FF0;</h3>
<p>&#x8BE5;&#x65B9;&#x6CD5;&#x5C06;&#x7528;&#x4E8E;&#x786E;&#x4FDD;&#x56FE;&#x5F62;&#x5217;&#x6709;&#x660E;&#x786E;&#x7684;&#x7C7B;&#x578B;&#x4FEE;&#x9970;&#x7B26;&#x6216;&#x9002;&#x5F53;&#x7684;&#x7A7A;&#x95F4;&#x7EA6;&#x675F;&#xFF0C;&#x4E3B;&#x8981;&#x7528;&#x6765;&#x89C4;&#x8303;&#x7A7A;&#x95F4;&#x8868;&#x7684;&#x7ED3;&#x6784;&#x3002;</p>
<h3 id="&#x51FD;&#x6570;&#x5B9A;&#x4E49;">&#x51FD;&#x6570;&#x5B9A;&#x4E49;</h3>
<p>1 &#x64CD;&#x4F5C;&#x9488;&#x5BF9;&#x5168;&#x90E8;&#x7A7A;&#x95F4;&#x8868;&#xFF1A;</p>
<pre class="language-"><code>text Populate_Geometry_Columns(boolean use_typmod=true);
</code></pre><p>&#x5165;&#x53C2;&#x5B9A;&#x4E49;&#xFF1A;</p>
<p>use_typmod=true&#xFF0C;&#x4F1A;&#x5F3A;&#x5236;&#x8BE5;&#x8868;&#x8868;&#x7ED3;&#x6784;&#xFF0C;&#x4F8B;&#x5982;&#x4F1A;&#x5C06;&#x5B57;&#x6BB5;&#x7C7B;&#x578B;&#x4E0D;&#x660E;&#x786E;&#x7684;geometry&#x6539;&#x6210;&#x7C7B;&#x578B;&#x660E;&#x786E;&#x7684;geometry(Point,4326)&#x7B49;&#x3002;</p>
<p>use_typmod=false&#xFF0C;&#x4E0D;&#x6539;&#x53D8;&#x8868;&#x7ED3;&#x6784;&#xFF0C;&#x4F46;&#x662F;&#x4F1A;&#x5F3A;&#x5236;&#x6DFB;&#x52A0;&#x7EF4;&#x5EA6;&#xFF0C;&#x5750;&#x6807;&#x7CFB;&#xFF0C;&#x56FE;&#x5F62;&#x7C7B;&#x578B;&#x7684;&#x7EA6;&#x675F;&#xFF0C;&#x89C4;&#x8303;&#x5199;&#x5165;&#x5E93;&#x7684;&#x6570;&#x636E;&#x3002;
2 &#x64CD;&#x4F5C;&#x4EC5;&#x4EC5;&#x9488;&#x5BF9;&#x6307;&#x5B9A;&#x7684;&#x67D0;&#x4E2A;&#x7A7A;&#x95F4;&#x8868;&#xFF1A;</p>
<pre class="language-"><code>int Populate_Geometry_Columns(oid relation_oid, boolean use_typmod=true);
</code></pre><h3 id="&#x4F7F;&#x7528;&#x524D;&#x63D0;">&#x4F7F;&#x7528;&#x524D;&#x63D0;</h3>
<p>1 &#x4FDD;&#x8BC1;&#x8868;&#x4E0D;&#x662F;&#x7A7A;&#x8868;&#xFF0C;&#x5373;&#x8981;&#x6709;&#x6570;&#x636E;&#xFF1B;
2 &#x4E14;&#x4FDD;&#x8BC1;&#x8868;&#x4E2D;&#x7684;geom&#x5B57;&#x6BB5;&#x975E;&#x7A7A;&#xFF1B;
3 &#x4E14;&#x4FDD;&#x8BC1;&#x8868;&#x4E2D;&#x6240;&#x6709;&#x56FE;&#x5F62;&#x90FD;&#x662F;&#x540C;&#x4E00;&#x4E2A;&#x7EF4;&#x5EA6;&#xFF0C;&#x5750;&#x6807;&#x7CFB;&#xFF0C;&#x548C;&#x56FE;&#x5F62;&#x7C7B;&#x578B;&#x3002;</p>
<h3 id="&#x5E94;&#x7528;&#x793A;&#x4F8B;">&#x5E94;&#x7528;&#x793A;&#x4F8B;</h3>
<p>1 &#x9488;&#x5BF9;&#x5168;&#x90E8;&#x7A7A;&#x95F4;&#x8868;&#xFF1A;</p>
<p>&#x5148;&#x521B;&#x5EFA;&#x4E24;&#x4E2A;schema,&#x6BCF;&#x4E2A;schema&#x4E0B;&#x518D;&#x5EFA;&#x7ACB;&#x4E24;&#x4E2A;&#x7A7A;&#x7684;&#x56FE;&#x5F62;&#x8868;&#xFF1A;</p>
<pre class="language-"><code>    create schema test1;
    create schema test2;

    create table test1.mytable1(
        gid serial primary key,
        name text,
        geom geometry
    );
    create table test2.mytable2(
        gid serial primary key,
        name text,
        geom geometry
    );
</code></pre><p>&#x8BF7;&#x6CE8;&#x610F;&#xFF0C;&#x76EE;&#x524D;&#x7684;&#x4E24;&#x4E2A;&#x56FE;&#x5F62;&#x8868;&#xFF0C;&#x90FD;&#x5DF2;&#x77E5;&#x5B57;&#x6BB5;&#x7C7B;&#x578B;&#x4E3A;geometry&#xFF0C;&#x4F46;&#x662F;&#xFF0C;&#x5E76;&#x4E0D;&#x6E05;&#x695A;&#x56FE;&#x5F62;&#x662F;&#x4E8C;&#x7EF4;&#x8FD8;&#x662F;&#x4E09;&#x7EF4;&#xFF0C;&#x56FE;&#x5F62;&#x662F;&#x70B9;&#x7EBF;&#x8FD8;&#x662F;&#x9762;&#xFF0C;&#x56FE;&#x5F62;&#x5750;&#x6807;&#x7CFB;&#x7A76;&#x7ADF;&#x662F;&#x591A;&#x5C11;&#x3002;</p>
<p>&#x5206;&#x522B;&#x5728;&#x4E24;&#x4E2A;&#x6D4B;&#x8BD5;&#x8868;&#x63D2;&#x5165;&#x6D4B;&#x8BD5;&#x6570;&#x636E;&#xFF1A;</p>
<pre class="language-"><code>INSERT INTO test1.mytable1(geom) VALUES(ST_GeomFromText(&apos;Point(118 32)&apos;,4326) );
INSERT INTO test2.mytable2(geom) VALUES(ST_GeomFromText(&apos;Point(118 32)&apos;,4326) );
</code></pre><p>&#x67E5;&#x8BE2;&#x73B0;&#x6709;&#x4E24;&#x5F20;&#x8868;&#x7684;&#x6570;&#x636E;&#x63CF;&#x8FF0;&#xFF1A;</p>
<pre class="language-"><code>select * from geometry_columns where f_table_name=&apos;mytest1&apos; or f_table_name=&apos;mytest2&apos;;
 f_table_catalog|f_table_schema|f_table_name|f_geometry_name|coord_dimension|srid|type
----------------+--------------+------------+---------------+---------------+----+-----
    test        | test2        | mytable2   | geom          | 2             | 0  |GEOMETRY
    test        | test1        | mytable1   | geom          | 2             | 0  |GEOMETRY
(2 row)
</code></pre><p>&#x7ED3;&#x8BBA;&#xFF1A;&#x76EE;&#x524D;&#x7684;srid&#x548C;type&#x90FD;&#x662F;&#x9ED8;&#x8BA4;&#x7684;&#xFF0C;&#x975E;&#x5177;&#x4F53;&#x660E;&#x786E;&#x5B9A;&#x4E49;&#x7684;&#x3002;</p>
<p>&#x6267;&#x884C;Populate_Geometry_Columns&#x65B9;&#x6CD5;&#xFF1A;</p>
<pre class="language-"><code>select Populate_Geometry_Columns();
populate_geometry_columns
 -----------------------
  probed:2 inserted:2
</code></pre><p>&#x7136;&#x540E;&#x67E5;&#x8BE2;&#x73B0;&#x6709;&#x4E24;&#x5F20;&#x8868;&#x7684;&#x6570;&#x636E;&#x63CF;&#x8FF0;&#xFF1A;</p>
<pre class="language-"><code>select * from geometry_columns where f_table_name=&apos;mytest1&apos; or f_table_name=&apos;mytest2&apos;;
 f_table_catalog|f_table_schema|f_table_name|f_geometry_name|coord_dimension|srid|type
----------------+--------------+------------+---------------+---------------+----+-----
    test        | test2        | mytable2   | geom          | 2             |4326|POINT
    test        | test1        | mytable1   | geom          | 2             |4326|POINT
(2 row)
</code></pre><p>&#x7ED3;&#x8BBA;&#xFF1A;&#x901A;&#x8FC7;&#x6267;&#x884C;Populate_Geometry_Columns&#x65B9;&#x6CD5;&#xFF0C;&#x5C06;&#x7D22;&#x5F15;&#x56FE;&#x5F62;&#x7C7B;&#x578B;&#x7B49;&#x4E0D;&#x660E;&#x786E;&#x7684;&#x7A7A;&#x95F4;&#x8868;&#x8F6C;&#x6362;&#x6210;&#x4E86;&#x5B9A;&#x4E49;&#x4E25;&#x683C;&#x7684;&#x7A7A;&#x95F4;&#x8868;&#x3002;</p>
<p>&#x5B9E;&#x9645;&#x4E0A;&#xFF0C;&#x8FD9;&#x6837;&#x7684;&#x573A;&#x666F;&#x5E76;&#x4E0D;&#x5E38;&#x89C1;&#x3002;&#x7EDD;&#x5927;&#x90E8;&#x5206;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x53EA;&#x4F1A;&#x6539;&#x67D0;&#x4E2A;&#x5177;&#x4F53;&#x7684;&#x8868;&#x3002;</p>
<p>2 &#x9488;&#x5BF9;&#x6307;&#x5B9A;&#x8868;
&#x5EFA;&#x7ACB;&#x6D4B;&#x8BD5;&#x8868;&#x5E76;&#x63D2;&#x5165;&#x6D4B;&#x8BD5;&#x6570;&#x636E;&#xFF1A;</p>
<pre class="language-"><code>  create table mytable(
        gid serial primary key,
        name text,
        geom geometry
    );
INSERT INTO mytable(geom) VALUES(ST_GeomFromText(&apos;Point(118 32)&apos;,4326) );
INSERT INTO mytable(geom) VALUES(ST_GeomFromText(&apos;Point(118 32)&apos;,4326) );
</code></pre><p>&#x6DFB;&#x52A0;&#x5F3A;&#x7EA6;&#x675F;&#xFF0C;&#x4E0D;&#x6539;&#x8868;&#x7ED3;&#x6784;&#xFF1A;</p>
<pre class="language-"><code>select Populate_Geometry_Columns(&apos;public.mytable&apos;::regclass,false);
--&#x67E5;&#x770B;&#x8868;&#x7ED3;&#x6784;
test=# \d+ mytable
                                                 Table &quot;public.mytable&quot;
 Column |   Type   | Collation | Nullable |               Default                | Storage  | Stats target | Description
--------+----------+-----------+----------+--------------------------------------+----------+--------------+-------------
 gid    | integer  |           | not null | nextval(&apos;mytable_gid_seq&apos;::regclass) | plain    |              |
 name   | text     |           |          |                                      | extended |              |
 geom   | geometry |           |          |                                      | main     |              |
Indexes:
    &quot;mytable_pkey&quot; PRIMARY KEY, btree (gid)
Check constraints:
    &quot;enforce_dims_geom&quot; CHECK (st_ndims(geom) = 2)
    &quot;enforce_geotype_geom&quot; CHECK (geometrytype(geom) = &apos;POINT&apos;::text)
    &quot;enforce_srid_geom&quot; CHECK (st_srid(geom) = 4326)
Access method: heap
</code></pre><p>&#x5982;&#x679C;&#x662F;&#x5E0C;&#x671B;&#x6539;&#x53D8;&#x8868;&#x7ED3;&#x6784;&#xFF1A;</p>
<pre class="language-"><code>drop table if exists mytable cascade;
create table mytable(
        gid serial primary key,
        name text,
        geom geometry
    );
INSERT INTO mytable(geom) VALUES(ST_GeomFromText(&apos;Point(118 32)&apos;,4326) );
INSERT INTO mytable(geom) VALUES(ST_GeomFromText(&apos;Point(118 32)&apos;,4326) );

select Populate_Geometry_Columns(&apos;public.mytable&apos;::regclass,true);
test=# \d+ mytable
                                                       Table &quot;public.mytable&quot;
 Column |         Type         | Collation | Nullable |               Default                | Storage  | Stats target | Description
--------+----------------------+-----------+----------+--------------------------------------+----------+--------------+-------------
 gid    | integer              |           | not null | nextval(&apos;mytable_gid_seq&apos;::regclass) | plain    |              |
 name   | text                 |           |          |                                      | extended |              |
 geom   | geometry(Point,4326) |           |          |                                      | main     |              |
Indexes:
    &quot;mytable_pkey&quot; PRIMARY KEY, btree (gid)
Access method: heap
</code></pre><h3 id="&#x989D;&#x5916;&#x6269;&#x5C55;">&#x989D;&#x5916;&#x6269;&#x5C55;</h3>
<p>&#x5176;&#x5B9E;Populate_Geometry_Columns&#x4E5F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x539F;&#x751F;&#x7684;pg sql&#x8BED;&#x6CD5;&#x5B9E;&#x73B0;&#xFF1A;
&#x6539;&#x53D8;&#x8868;&#x7C7B;&#x578B;&#xFF1A;</p>
<pre class="language-"><code>alter table mytable alter column geom type geometry(Point,4326) using geom::geometry(Point,4326);
</code></pre><p>&#x6DFB;&#x52A0;&#x56FE;&#x5F62;&#x7C7B;&#x578B;&#x7EA6;&#x675F;&#xFF1A;</p>
<pre class="language-"><code>alter table mytable add constraint enforce_geotype_geom CHECK (geometrytype(geom) = &apos;POINT&apos;::text);
</code></pre>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Find_SRID.html" class="navigation navigation-prev " aria-label="Previous page: 8.2.4 Find_SRID">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="UpdateGeometrySRID.html" class="navigation navigation-next " aria-label="Next page: 8.2.6 UpdateGeometrySRID">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"8.2.5 Populate_Geometry_Columns","level":"2.1.1.5","depth":3,"next":{"title":"8.2.6 UpdateGeometrySRID","level":"2.1.1.6","depth":3,"path":"vector_function/TableManager/UpdateGeometrySRID.md","ref":"vector_function/TableManager/UpdateGeometrySRID.md","articles":[]},"previous":{"title":"8.2.4 Find_SRID","level":"2.1.1.4","depth":3,"path":"vector_function/TableManager/Find_SRID.md","ref":"vector_function/TableManager/Find_SRID.md","articles":[]},"dir":"ltr"},"config":{"plugins":["pageview-count","prism","-highlight","custom-favicon","-sharing","emphasize","-lunr","-search","search-pro","graph","splitter","hide-element","folding-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism-okaidia.css"]},"emphasize":{},"splitter":{},"search-pro":{},"graph":{},"hide-element":{"elements":[".gitbook-link"]},"fontsettings":{"theme":"white","family":"sans","size":2},"folding-chapters":{},"favicon":"../gitbook/images/favicon.ico","pageview-count":{},"custom-favicon":{},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"xxx","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"service":"http://localhost:4000"},"title":"PostGIS中文指南","gitbook":"*","description":"记录PostGIS使用入门，进阶，提高，附带API全解析"},"file":{"path":"vector_function/TableManager/Populate_Geometry_Columns.md","mtime":"2024-07-23T08:43:00.331Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2024-07-23T09:36:52.257Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-folding-chapters/folding-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

